<?php
/**
 * 单条信息显示
 * User: ZFC
 * Date: 2015/7/7
 * Time: 16:50
 */

namespace common\widgets;

use Yii;
use yii\helpers\Html;

class InfoView extends Widget {

    public $columns = [];

    public $domID = '';

    public function init(){
        parent::init();

        if($this->domID == ''){
            $this->options['id'] = "infoTable_" . rand(1000, 9999);
        }
        echo Html::beginTag('table', $this->options) . "\n";
        echo $this->renderBodyBegin() . "\n";

    }



    public function run(){
        echo "\n" . $this->renderBodyEnd();
        echo "\n" . Html::endTag('table');
    }

    protected function renderBodyBegin(){

        $this->renderTable();
    }

    protected function renderBodyEnd(){

    }

    protected function renderTable(){
        $model = $this->model->getModel();
        var_dump($model);
    }

}